package com.ccepc.utility
{
	import avmplus.getQualifiedClassName;

	import com.anychart.AnyChart;
	import com.anychart.AnyChartFlex;
	import com.anychart.gantt.AnyGanttFlex;

	import flash.display.Sprite;

	import mx.logging.Log;

	public class AnyChartUtil
	{
		public function AnyChartUtil()
		{
		}

		public static function deleteGanttLogo(gantt:AnyGanttFlex):void
		{
			if (gantt)
			{
				if (gantt.numChildren > 0)
				{
					for (var i:Number = 0; i < gantt.numChildren; i++)
					{
						var childClass:String = getQualifiedClassName(gantt.getChildAt(i));
						if (childClass == "AnyGanttTrial")
						{
							var trail:Sprite = gantt.getChildAt(i) as Sprite;
							for (var j:Number = 0; j < trail.numChildren; j++)
							{
								if (getQualifiedClassName(trail.getChildAt(j)) == "flash.display::Bitmap")
								{
									trail.removeChildAt(j);
									return;
								}
							}
						}
					}
				}
			}

		}

		public static function deleteChartLogo(chart:AnyChartFlex):void
		{
			if (chart)
			{
				if (chart.numChildren > 0)
				{
					for (var i:Number = 0; i < chart.numChildren; i++)
					{
						var childClass:String = getQualifiedClassName(chart.getChildAt(i));
						trace(childClass);
						if (childClass == "flash.display::Bitmap")
						{
							chart.removeChildAt(i);
							return;
						}
					}
				}
			}

		}
	}
}

